using DataAccess.Entities;
using FluentNHibernate.Mapping;

namespace DataAccess.Mappings
{
    public class DiscussionMap : ClassMap<Discussion>
    {
        public DiscussionMap()
        {
            Id(x => x.Id);
            Map(x => x.Title);
            Map(x => x.Description);
            References(x => x.Owner);
            Map(x => x.DateCreated);
            HasManyToMany(x => x.Categories).Cascade.All().Table("DiscussionCategories");
            HasManyToMany(x => x.Comments).Cascade.All().Table("DiscussionComments");
        }
    }
}